Chore: add Apple Silicon iOS Simulator support for iOS 26+#871
Closed
arrrrny wants to merge 3 commits into
Closed
Conversation
Apple removed Rosetta 2 from the default iOS 26 simulator runtime, which breaks `flutter run` for any project depending on Google ML Kit on Apple Silicon Macs. The published GoogleMLKit/* CocoaPods only ship arm64-iphoneos and x86_64-iphonesimulator slices and pin EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64, so the simulator build no longer finds a matching destination and dies with "Unable to find a destination matching the provided destination specifier". Until Google publishes proper arm64-iphonesimulator slices (https://issuetracker.google.com/issues/178965151), this change ships an opt-in Podfile helper under google_mlkit_commons that: 1. Re-labels the existing arm64 device slice of every ML Kit framework binary as iOS Simulator. Only the 4-byte LC_BUILD_VERSION.platform field is changed (2 -> 7), the same approach the well-known arm64-to-sim tool uses on closed-source SDKs. Idempotent. 2. Strips EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 from the xcconfigs CocoaPods generates from the pod's user_target_xcconfig, so the user's app target is allowed to build for arm64-iphonesimulator. The example/ios Podfile is wired to call the helper from post_install, which lets the example app build, install and run on an Apple Silicon iOS 26.3 simulator. End-to-end validated: Text Recognition on the Text-From-Widget view returned the exact widget text. Device builds and release builds are not affected. Closes flutter-ml#825
The Ruby and Python entry points already have a brief header pointing at the README. Per-function docstrings were restating what the function name already said, and the Podfile inline comments duplicated the helper's self-documenting name.
Author
|
Closing this PR as duplicate - the changes are already covered by the excellent PR #862 from @lucasdonordeste and the Swift Package Manager changes in PR #870. A combined reference branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Apple Silicon iOS Simulator support for iOS 26+ simulators.
Problem
Google's
GoogleMLKit/*pods only shiparm64-iphoneosandx86_64-iphonesimulatorslices and excludearm64from simulator builds. On Apple Silicon Macs running iOS 26+ simulators (where Rosetta 2 is no longer the default for the iOS Simulator),flutter runfails withUnable to find a destination matching the provided destination specifier.Upstream Google bug: https://issuetracker.google.com/issues/178965151
Solution
This plugin ships an opt-in Podfile helper that:
LC_BUILD_VERSION.platformswap used by the well-knownarm64-to-simtool)EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64from the generated xcconfigsChanges
apple_silicon_simulator.rbRuby helper scriptpatch_arm64_simulator.pyPython script to re-label Mach-O objectsUsage
Add two lines to your iOS
Podfile:Then re-run
pod install. The example app underpackages/exampleis already wired up this way.Original contribution by @lucasdonordeste